package com.yc.project2_knn;


import com.yc.project2_knn.bean.BankMarketing;

import java.util.*;

public class Tset_Main {
    public static void main(String[] args) {
        //问题： 路径怎么找
        //用System.getProperty("user.dir);// 项目执行路径
        //用System.getProperty("user.home);  //用户目录   c:\\users\用户名
        System.out.println("项目执行路径: "+ System.getProperty("user.dir"));//D:\software\ideaIU\IntelliJ IDEA 2023.2.5\ideaprojects\gitee_thread
        //看发布路径  不是src  D:\software\ideaIU\IntelliJ IDEA 2023.2.5\ideaprojects\gitee_thread\src\main\java\com\yc\project2_knn\data
        //D:\software\ideaIU\IntelliJ IDEA 2023.2.5\ideaprojects\gitee_thread\src\main\java\com\yc\project2_knn
        String path =System.getProperty("user.dir")+ "\\src\\main\\java\\com\\yc\\project2_knn\\data\\bank.data";
        System.out.println(path);
        List<BankMarketing> list =BankMarketingLoaader.load(path);
        for (BankMarketing bm:list) {
            System.out.println(bm);
        }
        System.out.println("训练集大小："+list.size());
        EuclideanDistanceCalculator edc = new EuclideanDistanceCalculator();
        System.out.println( edc.calculator(new Student(2,4),new Student(3,5)));

        //对数组排序
        int[] x = new int[]{4, 2, 5, 7};
//        Arrays.sort(x); //单线程
        Arrays.parallelSort(x);
        for (int t:x) {
            System.out.print(t+" ");
        }
        //对数组集合排序
        List<Integer> l =new ArrayList<>();
        l.add(1);
        l.add(100);
        l.add(3);
        Collections.sort(l);
    }
}
